<template>
<!-- 举报核实系统页 -->
  <div class="container">
    <!-- <el-table  :data="list.slice((currentPage-1)*pagesize, currentPage*pagesize)" fit highlight-current-row style="width: 100%"> -->
    <el-table id="inform" highlight-current-row style="width: 100%" :header-cell-style="{background:'#EEF3FC',color:'#333333'}"  :data="list">
      <el-table-column
        label="序号"
        type="index"
        style="width: 8%"
        align="center">
      </el-table-column>
      <el-table-column style="width: 12%" align="center" label="投诉类型">
        <template slot-scope="scope">
          <span>{{ scope.row.complaintType   || '—'}}</span>
        </template>
      </el-table-column>

      <el-table-column style="width: 12%" align="center" label="机构名称">
        <template slot-scope="scope">
          <span>{{ scope.row.firmName  || '—' }}</span>
        </template>
      </el-table-column>
      <el-table-column style="width: 12%" align="center" label="培训类型">
        <template slot-scope="scope">
          <span>{{ scope.row.trainingType   || '—'}}</span>
        </template>
      </el-table-column>
      <el-table-column style="width: 12%" align="center" label="举报时间">
        <template slot-scope="scope">
          <span>{{ scope.row.createTime  || '—'}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="isShow == '1'" style="width: 12%" align="center" label="核实人">
        <template slot-scope="scope">
          <span>{{ scope.row.auditUser  || '—'}}</span>
        </template>
      </el-table-column>
       <el-table-column v-if="isShow == '2'" style="width: 12%" align="center" label="执法人">
        <template slot-scope="scope">
          <span>{{ scope.row.lawPerson  || '—'}}</span>
        </template>
      </el-table-column>
       <el-table-column v-if="isShow == '2'" style="width: 12%" align="center" label="执法时间">
        <template slot-scope="scope">
          <span>{{ scope.row.lawTime  || '—'}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="isShow == '1'" style="width: 12%" align="center" label="核实时间">
        <template slot-scope="scope">
          <span>{{ scope.row.auditTime  || '—'}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="isShow == '1'" style="width: 12%" align="center" label="是否属实">
      <template slot-scope="scope">
        <span>{{scope.row.auditResult==0?'否':'是'}}</span>
      </template>
    </el-table-column>
      <el-table-column style="width: 12%" align="center" label="操作">
        <template slot-scope="scope">
          <el-button type="text"  @click="urlDetailChange(scope.row)">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import * as api from "@/api/reportList/reportList.js"
  export default {
    filters: {
      statusFilter(status) {
        const statusMap = {
          published: 'success',
          draft: 'info',
          deleted: 'danger'
        }
        return statusMap[status]
      }
    },
    props: {
      type:{
        type:String
      },
      list: {
        type: Array
      }
    },
    data() {
      return {
        // 存储举报核实系统数组
        informList: [],
        isShow:0,
        listQuery: {
          page: 1,
          limit: 5,
          type: this.type,
          sort: '+id'
        },
        // 传递过来的核实类型
        typeData:0,
        currentPage:1,
          // 分页加载
        loading: false,
        pageSizes: [10, 50, 100, 200, 500],
        pagesize:10,
        total: 0,
        currentPage:1,
      }
    },
     // 监听路由
    watch: {
      $route: {
        deep: true,
        immediate: true,
        handler(val) {
          console.log('监听举报路由',val.query.tab)
          if(val.query){
            this.isShow=val.query.tab
          }
        }
      }
    },
    created() {
      console.log('举报核实列表获取传递过来的举报核实列表',this.list)
    },
    methods: {
    
      // 详情跳转
      urlDetailChange(row){
        console.log('获取跳转携带的详情数据',row,this.isShow)
        let id=''
        console.log('获取转转的',id)
        this.$router.push(
          { name: 'inform-particulars',
           params: {id:this.type,reportId:row.reportId,} 
          }
        )
      },
      open() {
        this.$alert('<strong>机构内容从法理基础来讲，教育培训机构享有的权利属于社会教育权，其存在具有一定的法理基础，教育培训机构在民法中是“特殊企业法人”，其公益属性是不同于一般企业法人最显著的特征；在行政法中是“行政相对人”，与政府构成行政法律关系。归属于社会教育权范畴的教育培训机构，相对于国家教育权而言，具有独特的法律属性。</strong>', '未通过原因', {
          dangerouslyUseHTMLString: true
        });
      },


      current_change:function(currentPage){
        this.currentPage = currentPage;
      },
    }
  }
</script>
<style scoped lang='scss'>
.container{
  // 设置表格的每一个表格的高度
  /deep/.el-table td, .el-table th{
    padding: 4px 0;
  }
}

</style>

